﻿@model RuTracker.Interface.Dropbox.StorageFolder
@using RuTracker.Interface.Dropbox
@using RuTracker.MVC.Core.HtmlHelpers
@using RuTrackerLib


@{
    ViewBag.Title = "SelectDropboxFolder";
}
<!DOCTYPE html>

<html>
    <head>
        <link href="@Url.Content("~/Styles/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Styles/validation.css")" rel="stylesheet" type="text/css" />
        <meta name="viewport" content="width=device-width" />
        <title>Select folder</title>
    </head>
<body>
    <div>
        <div>
            <h2>
                Please select Dropbox folder
            </h2>
        </div>
        <div>
            @(
                    Html.TreeView(Model.Children.OfType<StorageFolder>())
                        .EmptyContent("There is no folders in your account")
                        .Children(c => c.Children.OfType<StorageFolder>())
                        .ChildrenHtmlAttributes(new { @class = "subItem"})
                        .ItemText(m => m.Name)
                        .ItemTemplate(
                            @<text>
                                 @Html.RouteLink(@item.Name, "Settings", new { id = @StringEncryptor.Encrypt(item.FullName) }, null)
                             </text>)
                                  )
        </div>
    </div>
</body>
</html>
